<p>An AsyncGenerator object is an instance of an async generator function and conforms to both the AsyncIterator and AsyncIterable interfaces.</p>

<p>AsyncGenerator instances directly inherit properties from the object that is the value of the `prototype` property of the AsyncGenerator function that created the instance. AsyncGenerator instances indirectly inherit properties from the AsyncGenerator Prototype intrinsic, %AsyncGeneratorPrototype%.</p>

<emu-clause id="sec-properties-of-asyncgenerator-prototype">
  <h1>Properties of AsyncGenerator Prototype</h1>
  <p>The AsyncGenerator prototype object is the <dfn>%AsyncGeneratorPrototype%</dfn> intrinsic. It is also the initial value of the `prototype` property of the %AsyncGenerator% intrinsic (the AsyncGeneratorFunction.prototype).</p>
  <p>The AsyncGenerator prototype is an ordinary object. It is not an AsyncGenerator instance and does not have an [[AsyncGeneratorState]] internal slot.</p>
  <p>The value of the [[Prototype]] internal slot of the AsyncGenerator prototype object is the intrinsic object %AsyncIteratorPrototype%. The initial value of the [[Extensible]] internal slot of the AsyncGenerator prototype object is *true*.</p>
  <p>All AsyncGenerator instances indirectly inherit properties of the AsyncGenerator prototype object.</p>

  <emu-clause id="sec-asyncgenerator-prototype-constructor">
    <h1>AsyncGenerator.prototype.constructor</h1>
    <p>The initial value of `AsyncGenerator.prototype.constructor` is the intrinsic object %AsyncGenerator%.</p>
    <p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
  </emu-clause>

  <emu-clause id="sec-asyncgenerator-prototype-next">
    <h1>AsyncGenerator.prototype.next ( _value_ )</h1>
    <emu-alg>
      1. Let _generator_ be the `this` value.
      1. Let _completion_ be NormalCompletion(_value_).
      1. Return ! AsyncGeneratorEnqueue(_generator_, _completion_).
    </emu-alg>
  </emu-clause>

  <emu-clause id="sec-asyncgenerator-prototype-return">
    <h1>AsyncGenerator.prototype.return ( _value_ )</h1>
    <emu-alg>
      1. Let _generator_ be the `this` value.
      1. Let _completion_ be Completion{[[Type]]: ~return~, [[Value]]: _value_, [[Target]]: ~empty~}.
      1. Return ! AsyncGeneratorEnqueue(_generator_, _completion_).
    </emu-alg>
  </emu-clause>

  <emu-clause id="sec-asyncgenerator-prototype-throw">
    <h1>AsyncGenerator.prototype.throw ( _exception_ )</h1>
    <emu-alg>
      1. Let _generator_ be the `this` value.
      1. Let _completion_ be Completion{[[Type]]: ~throw~, [[Value]]: _exception_, [[Target]]: ~empty~}.
      1. Return ! AsyncGeneratorEnqueue(_generator_, _completion_).
    </emu-alg>
  </emu-clause>

  <emu-clause id="sec-asyncgenerator-prototype-tostringtag">
    <h1>AsyncGenerator.prototype [ @@toStringTag ]</h1>
    <p>The initial value of the @@toStringTag property is the String value `"AsyncGenerator"`.</p>
    <p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
  </emu-clause>

</emu-clause>

<emu-clause id="sec-properties-of-asyncgenerator-intances">
  <h1>Properties of AsyncGenerator Instances</h1>
  <p>AsyncGenerator instances are initially created with the internal slots described below:</p>
  <emu-table id="table-internal-slots-of-asyncgenerator-instances" caption="Internal Slots of AsyncGenerator Instances">
    <table>
      <tbody>
      <tr>
        <th>Internal Slot</th>
        <th>Description</th>
      </tr>
      <tr>
        <td>[[AsyncGeneratorState]]</td>
        <td>The current execution state of the async generator. The possible values are: *undefined*, `"suspendedStart"`, `"suspendedYield"`, `"executing"`, `"awaiting-return"`, and `"completed"`.</td>
      </tr>
      <tr>
        <td>[[AsyncGeneratorContext]]</td>
        <td>The execution context that is used when executing the code of this async generator.</td>
      </tr>
      <tr>
        <td>[[AsyncGeneratorQueue]]</td>
        <td>A List of AsyncGeneratorRequest records which represent requests to resume the async generator.</td>
      </tr>
      </tbody>
    </table>
  </emu-table>
</emu-clause>

<emu-clause id="sec-asyncgenerator-abstract-operations">
  <h1>AsyncGenerator Abstract Operations</h1>
  <emu-import href="./abstract-operations.html"></emu-import>
</emu-clause>
